﻿using AccustomeAttributedll;
using ISaveReaddll;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;

namespace FinalTestMachine.Funs
{
    /// <summary>
    /// 光管设置
    /// </summary>
    class FunLightPipeSettings : FunsSelectionHelperbase
    {

        public static readonly FunLightPipeSettings Cur = new FunLightPipeSettings();

        private FunLightPipeSettings()
        {
            Read();
        }
        public static FunLightPipeSettings CreateInstrance()
        {
            return Cur;
        }

        public Dictionary<string, bool> LightPipeLimitDict => new Dictionary<string, bool>()
        {
            ["光管右上"] = IsUseLightPipe1,
            ["光管右下"] = IsUseLightPipe2,
            ["光管左下"] = IsUseLightPipe3,
            ["光管左上"] = IsUseLightPipe4,
            ["光管中心"] = IsUseLightPipe5,
        };

        public bool CheckCurrentLighgPiPeCanUse(string lightPipeName)
        {
            if (LightPipeLimitDict.ContainsKey(lightPipeName))
            {
                if (LightPipeLimitDict[lightPipeName])
                    return true;
                else
                    return false;
            }
            else
            {
                throw new ArgumentException("输入光管名称错误", nameof(lightPipeName));
            }
        }

        [SaveRemark]
        [FunctionSelectionRemark("光管右上", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseLightPipe1 = true;

        [SaveRemark]
        [FunctionSelectionRemark("光管右下", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseLightPipe2 = true;

        [SaveRemark]
        [FunctionSelectionRemark("光管左下", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseLightPipe3 = true;

        [SaveRemark]
        [FunctionSelectionRemark("光管左上", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseLightPipe4 = true;

        [SaveRemark]
        [FunctionSelectionRemark("光管中心", new string[] { "启用", "禁用" }, 0)]
        public bool IsUseLightPipe5 = true;

        public bool IsLightPipeAngleConfirm = true;


    }
}
